﻿<Window x:Class="Reckoning.StopWordsWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"        
        xmlns:l="clr-namespace:Reckoning"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:p="clr-namespace:Reckoning.Properties"        
        MaxHeight="480" 
        MaxWidth="240"         
        SizeToContent="Width"
        Icon="/Reckoning;component/Resources/abacus.jpg"
        Title="{x:Static p:Resources.LabelEditStopWordsTitle}" Closing="Window_Closing">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />            
        </Grid.RowDefinitions>
        
        <StackPanel Orientation="Horizontal"
                    Margin="6,6,6,6">
            <Label Name="labelNumStopWordsDesc"
                   Content="{x:Static p:Resources.LabelNumStopWords}" />
            <Label Name="labelNumStopWords"
                   Content="{Binding ElementName=dataGridStopWords, Path=Items.Count}" 
                   Margin="6,0,0,0"/>
        </StackPanel>
                    
        <DataGrid Name="dataGridStopWords" 
                  ItemsSource="{Binding StopWordsEdit, Mode=TwoWay}" 
                  Grid.Row="1"                        
                  HorizontalGridLinesBrush="#FF938D8D" VerticalGridLinesBrush="#FF938D8D" 
                  AlternatingRowBackground="{DynamicResource {x:Static SystemColors.GradientInactiveCaptionBrushKey}}"                   
                  Margin="6,6,6,6"             
                  AutoGenerateColumns="False"
                  CanUserAddRows="True" CanUserDeleteRows="True"
                  TabIndex="0" IsTabStop="True">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Word, Mode=TwoWay}" 
                                    Width="*"/>
            </DataGrid.Columns>
        </DataGrid>
        
        <StackPanel Orientation="Horizontal"
                    Grid.Row="2"
                    HorizontalAlignment="Center"
                    Margin="6,6,6,6">
            
            <Button Name="buttonSaveStopWords"
                    Content="{x:Static p:Resources.LabelSaveStopWords}"                     
                    Command="{Binding SaveStopWordsCommand}"
                    Padding="6,2,6,2"                    
                    TabIndex="1" />

            <Button Name="buttonRestoreStopWords"
                    Content="{x:Static p:Resources.LabelRestoreStopWords}"
                    Command="{Binding RestoreStopWordsCommand}"
                    Margin="6,0,0,0" Padding="6,2,6,2"
                    HorizontalAlignment="Right" 
                    TabIndex="2" />
        </StackPanel>
    </Grid>
</Window>
